<template>
  <div>
    <div

      v-infinite-scroll="loadMore"
      infinite-scroll-disabled="loading"
      infinite-scroll-distance="100">
      <div v-for="item in list"
      :style="{width:'45%',float:'left',marginBottom:'7px',marginLeft:'3.5%',paddingBottom:'10px',textAlign:'center',display:'link-block'}"
      >
        <img  v-bind:src='getImage(item.Rank)' alt="" :style="{height:'110px',marginTop:'10'}">
        <div :style="{marginTop:'5px'}">年龄:{{item['TestUser']}}</div>
        <div :style="{fontSize:'10px',color:'#898989',marginTop:'5px'}">测试时间:{{item['AddTime']}}</div>
        <div
          @click="Jump(item.Id)"
          :style="{width:'80%',marginLeft:'10%',marginTop:'5px',height:'30px',background:'#4dc1c1',textAlign:'center',lineHeight:'30px',color:'#fff',borderRadius:'5px'}">点击查询</div>
      </div>
    </div>
    <div :style="{height:'50px',width:'100%',float:'left'}">

    </div>
  </div>

</template>

<script>
    import {getEvaPast} from "../../netWork/EvaApi";
    export default {
        name: "eva-past",
        data(){
          return{
            busy: false,
            list:[]
          }

        },
      mounted: function() {
          this.req_data()
        // console.log(this.$store.state.userInformation['UserId'])
      },
      methods: {
        Jump(cont){
          console.log(cont)
          this.$router.push({path:'/EvaViewReport'})
        },
        getImage(imageRank) {
          switch (imageRank) {
            case "A":
              return require('./img/A.png');

            case "B":
              return require('./img/B.png');

            case "C":
              return require('./img/C.png');

            case "D":
              return require('./img/D.png');

            case "E":
              return require( './img/E.png');

          }
        },
        loadMore() {
          const self=this;
          self.loading = true;
          setTimeout(() => {

            self.loading = false;
          }, 500);
        },
        req_data(){
          let fromData={
            UserId:this.$store.state.userInformation['UserId']?this.$store.state.userInformation['UserId']:null
          };
          getEvaPast(fromData,(responseData)=>{
            if(responseData['code']==="1"){
              console.log(responseData['data'][0])
              this.list=responseData['data']
            }

          })
        }
      }
    }
</script>

<style scoped>

</style>
